Despite its apparent similarity to microprocessors used in personal computers (PC), a microcontroller or an embedded controller offers a number of additional functions that are implemented on the same semiconductor substrate (i.e., chip). In a typical PC, a microprocessor performs basic operation functions while other integrated circuits perform other functions such as network communication, input/output transmission, peripheral device control, and the like. In a typical microcontroller, these additional functions are commonly established in a single integrated circuit. A typical microcontroller includes a central processing unit (CPU), a memory interface or a memory controller for interface with an external memory, and various function blocks or peripheral devices.
As the embedded controller or the microcontroller is deployed in a variety of applications, function blocks or peripheral devices for performing newly required functions may be added to the embedded controller or the microcontroller or may be substituted for other function blocks or peripheral devices. In a case where a function block is newly embedded in a microcontroller as a peripheral device, there is a need for verifying whether the function block operates correctly. The verification may optionally be done using a value stored in an internal state register for storing operation state information. The data read-out from the internal state register is to be used to debug the function block.
Conventionally, a debugging program is used to debug a function block. A central processing unit periodically or randomly reads out data stored in a state register of a function block or a peripheral device according to a debugging program. The read-out data is then stored in an external memory, and in turn used to debug the function block. Since many cycles are needed when the debugging program is used to access the state register of the function block, it is impossible to obtain varied operation state information of the state register in real time. For direct access to the data stored in the state register of the function block in real time, a specific test pin directly connected to the state register may be provided to a microcontroller. However, this approach requires that the test pin is unavailable for use during runtime operation of the microcontroller or an embedded controller.
A method for obtaining operation state information stored in a state register of a function block (or peripheral device states) by means of a scan structure is disclosed in U.S. Pat. No. 6,363,501 entitled “METHOD AND APPARATUS FOR SAVING AND LOADING PERIPHERAL DEVICE STATES OF A MICROCONTROLLER VIA A SCAN PATH”, issued to Tobis et al., Mar. 26, 2002. This patent discloses the technique that registers in peripheral devices (or function blocks) are scan-connected in series to sequentially store values of the registers in an external memory. In this case, the values of the registers are obtained while the embedded controller or microcontroller is in a paused state. Thus, this approach does not provide for the debugging of function blocks or peripheral devices during real-time operation of the microcontroller.
A technique for providing a special test port into a microcontroller so as to check operation states of peripheral devices in real time is disclosed in U.S. Pat. No. 5,248,770 entitled “SINGLE-CHIP MICROCONTROLLER WITH EFFICIENT PERIPHERAL TESTABILITY”, issued to Garner, Jun. 27, 1995. In this patent, a test port is directly connected to an external test apparatus and is used in direct communication with peripheral devices. In this manner, it is possible to directly access the peripheral devices via the test port. However, this technique demands additional test pins as well as an external test apparatus.